package com.example.kcp.enums;

import lombok.Getter;

/**
 * @author "陈凯航"
 * @date 2024/10/7
 * @mail "mengxingcn@aliyun.com"
 */
@Getter
public enum ServiceCode {
    DEFAULT((byte) 0x00);
    private final byte value;

    ServiceCode(byte b) {
        this.value=b;
    }

    public static ServiceCode ofByte(byte b){
        for (ServiceCode value : ServiceCode.values()) {
            if (value.getValue()==b) return value;
        }
        throw new IllegalArgumentException("invalid Parameter Exception byte: "+b);
    }

}
